home *** CD-ROM | disk | FTP | other *** search
- Path: uuneo.neosoft.com!usenet
- From: reynolds@neosoft.com
- Newsgroups: comp.lang.c++
- Subject: need help on VERY simple program. I am a beginner, so this is an easy question!!!
- Date: Sun, 04 Feb 1996 22:41:23 -0600
- Organization: NeoSoft Internet Services +1 713 968 5800
- Message-ID: <31158A73.3B43@neosoft.com>
- NNTP-Posting-Host: tuffy-ppp-f4.neosoft.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (Win95; I)
- CC: reynolds@neosoft.com
-
- To anyone out there please tell me how to use the ternary operator (?:)
- underneath an if else statement. I am having trouble eliminating a line
- of text when I do not want it there. Here is my program:
- //Calculator(is just a practice program I made up)
- #include <iostream.h>
-
- main ()
- {
- long integer1, integer2, sum, difference, product, quotient;
- cout << "enter first integer\n";
- cin >> integer1;
- cout << "enter second integer\n";
- cin >> integer2;
- if (integer1 == integer2)
- cout << "These two numbers are equal!!\n";
- if (integer1 > integer2)
- cout << "First integer greater than second!!\n";
- else
- //This is the statement which I want to clear IF integer1 == integer2
- cout << "Second integer greater than first!!\n";
- and so on. . .
- Please answer by writing to me at reynolds@neosoft.com
- I would appreciate any answer I receive. Thanks so much,
- ---John Reynolds
-